import express from 'express'
import cors from 'cors'
import bodyParser from 'body-parser'
import gameRoutes from './routes/gameRoutes'

const app = express()
const PORT = process.env.PORT || 3000

// 中间件
app.use(cors())
app.use(bodyParser.json())

// 路由
app.use('/api', gameRoutes)

// 启动服务器
app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`)
})